﻿#region Copyright

//  ======================================================
//      Copyright (c) 2011 Toulr All rights reserved.
//     
//      The use and distribution terms for this software are contained in the file
//      named license.txt, which can be found in the root of this distribution.
//      By using this software in any fashion, you are agreeing to be bound by the
//      terms of this license.
//     
//     You must not remove this notice, or any other, from this software.
//  ======================================================

#endregion

#region Using Namespaces

using System;
using Toulr.Util.Resource;

#endregion

namespace Toulr.Models
{
    public class ActionResult<TResult>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ActionResult"/> class.
        /// </summary>
        /// <param name="resultCode">The result code.</param>
        /// <param name="tips">The tips.</param>
        /// <param name="result">The result.</param>
        /// Author: James Cheung
        /// MachineName: JAMESCHEUNG-PC
        /// DateTime: 2011/5/10 17:37
        public ActionResult(int resultCode, String tips, TResult result)
        {
            ResultCode = resultCode;
            Tips = tips;
            Result = result;
        }

        /// <summary>
        ///   返回操作结果编号 0为正常完成请求，其它号码为发生异常，具体号码对应异常值在Errors资源文件中定义
        /// </summary>
        public int ResultCode { get; set; }

        /// <summary>
        ///   保存需要呈现给用户的提示信息
        /// </summary>
        public String Tips { get; set; }

        /// <summary>
        ///   结果对象
        /// </summary>
        public TResult Result { get; set; }


    }
}